package com.eee.common.util;

import java.util.Random;

import org.springframework.stereotype.Component;

/**
 * 正则表达式的工具类
 * 
 * @author eee
 *
 */
@Component("regexUtil")
public class RegexUtil
{
	public String randStr = "1234567890QWERTYUIOPASDFGHJKLMNBVCXZqwertyuioplkjhgfdsazxcvbnm";

	public String randString(int length)
	{
		StringBuffer sb = new StringBuffer();
		Random rand = new Random();
		for (int i = 0; i < length; i++)
		{
			int randCh = rand.nextInt(this.randStr.length());
			sb.append(this.randStr.charAt(randCh));
		}
		return sb.toString();
	}
}
